package com.yoga.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yoga.dao.CoachMapper;
import com.yoga.model.Coach;
import com.yoga.model.search.CoachSearchBean;
import com.yoga.service.CoachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yan
 * @date 2025/8/15
 */
@Service
public class CoachServiceImpl implements CoachService {
    private CoachMapper coachMapper;
    @Autowired
    public void setCoachMapper(CoachMapper coachMapper) {
        this.coachMapper = coachMapper;
    }

    @Override
    public Page<Coach> findAll(Page<Coach> page, CoachSearchBean csb) {
        return coachMapper.findAll(page,csb);
    }

    @Override
    public int deleteById(List<Integer> ids) {
        return coachMapper.deleteByIds(ids);
    }

    @Override
    public boolean add(Coach coach) {
        return coachMapper.insert(coach)>0;
    }

    @Override
    public boolean update(Coach coach) {
        return coachMapper.updateById(coach)>0;
    }
}
